Learn R Programming

harmonicmeanp (version 3.0.1)

Landau Distribution: The Landau Distribution

Description

Density, distribution function, quantile function and random number generation for the Landau distribution with location parameter mu and scale parameter sigma.

Usage

dLandau(x, mu=log(pi/2), sigma=pi/2, log=FALSE)
pLandau(x, mu=log(pi/2), sigma=pi/2, log=FALSE, lower.tail=TRUE)
qLandau(p, mu=log(pi/2), sigma=pi/2, log=FALSE, lower.tail=TRUE)
rLandau(n, mu=log(pi/2), sigma=pi/2)

Value

dLandau produces the density, pLandau the tail probability, qLandau the quantile and rLandau random variates for the Landau distribution.

Arguments

x

The value or vector of values of the Landau-distributed random variable.

mu

The location parameter of the Landau distribution. Defaults to log(pi/2) to give Landau's original distribution.

sigma

The scale parameter of the Landau distribution. Defaults to pi/2 to give Landau's original distribution.

log

If true the log probability is output.

lower.tail

If true (the default) the lower tail probability is returned. Otherwise the upper tail probability.

p

The value or vector of values, between 0 and 1, of the probability specifying the quantile for which to return the Landau random variable x.

n

The number of values to simulate.

Author

Daniel J. Wilson

Details

The density of the Landau distribution can be written $$f(x)=\frac{1}{\pi\,\sigma}\int_0^\infty \exp\left(-t\frac{(x-\mu)}{\sigma}-\frac{2}{\pi}t\log(t)\right)\,\sin\left(2t\right)\textrm{d}t$$

References

Landau LD (1944) On the energy loss of fast particles by ionization. J Phys USSR 8:201-205.

Daniel J. Wilson (2019) The harmonic mean p-value for combining dependent tests. Proceedings of the National Academy of Sciences USA 116: 1195-1200.

See Also

p.hmp

Examples

Run this code
# For detailed examples type vignette("harmonicmeanp")
# Example: simulate from a non-uniform distribution mildly enriched for small \emph{p}-values. 
# Compare the significance of the combined p-value for Bonferroni, Benjamini-Hochberg (i.e. Simes), 
# HMP and (equivalently) MAMML with 2 degrees of freedom.
L = 1000
p = rbeta(L,1/1.5,1)
min(p.adjust(p,"bonferroni"))
min(p.adjust(p,"BH"))
x = hmp.stat(p)
pLandau(1/x,log(length(p))+(1 + digamma(1) - log(2/pi)),pi/2,lower.tail=FALSE)
p.hmp(p,L=L)
p.mamml(1/p,2,L=L)

Run the code above in your browser using DataLab